﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace Domaine.Entity
{
    public class Role
    {
        #region Members

        string _RoleName;

        #endregion

        #region Ctor

        public Role() { RoleID = Guid.NewGuid(); }

        #endregion

        #region Properties

        [Key]
        public Guid RoleID { get; set; }

       
        [Required]
        [MaxLength(256)]
        public string RoleName
        {
            get { return _RoleName; }
            set { _RoleName = value; LoweredRoleName = value.ToLower(); }
        }
        [Required]
        [MaxLength(256)]
        public string LoweredRoleName { get; set; }

        [MaxLength(256)]
        public string Description { get; set; }

        public AspApplication Application { get; set; }

        [Required]
        public Guid ApplicationID { get; set; }

        public virtual ICollection<User> Users { get; set; }
        #endregion


    }
}
